package com.pgyl.contract.validator;

import com.pgyl.contract.exceptions.ValidationException;
import com.pgyl.contract.model.SalesContract;
import org.springframework.stereotype.Component;

// 销售合同校验实现
@Component
public class SalesContractValidator implements ContractValidator<SalesContract> {
    @Override
    public void validate(SalesContract contract) throws ValidationException {
        if (!contract.getContractNumber().startsWith("S")) {
            throw new ValidationException("销售合同编号必须S开头");
        }
        // 其他校验规则...
    }
}
